package com.yumi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 任务实体类
 */
@Data
@TableName("work_task")
@Schema(description = "任务信息")
public class Task {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "任务ID")
    private Long id;

    /**
     * 任务标题
     */
    @Schema(description = "任务标题", required = true)
    private String title;

    /**
     * 任务内容
     */
    @Schema(description = "任务内容")
    private String content;

    /**
     * 优先级：1-低 2-中 3-高
     */
    @Schema(description = "优先级：1-低 2-中 3-高", defaultValue = "1")
    private Integer priority;

    /**
     * 状态：0-未开始 1-进行中 2-已完成
     */
    @Schema(description = "状态：0-未开始 1-进行中 2-已完成", defaultValue = "0")
    private Integer status;

    /**
     * 截止日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "截止日期", example = "2023-12-31 23:59:59")
    private LocalDateTime deadline;

    /**
     * 负责人ID
     */
    @Schema(description = "负责人ID")
    private Long employeeId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间", accessMode = Schema.AccessMode.READ_ONLY)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间", accessMode = Schema.AccessMode.READ_ONLY)
    private LocalDateTime updateTime;

    /**
     * 是否删除：0-未删除 1-已删除
     */
    @TableLogic
    @Schema(description = "是否删除", hidden = true)
    private Integer isDeleted;
} 